<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>4.svg绘制线段</title>
  <style>
    svg {
      width: 800px;
      height: 600px;
    }
  </style>
</head>
<body>
  <svg>
    <line x1="100" y1="100" x2="200" y2="200" stroke="#000"></line>

    <line x1="300" y1="100" x2="300" y2="400" style="stroke: blue;"></line>

    <polyline points="
      300 50
       400 420
      360 520
      160 320
       " fill-opacity="0" stroke="#000"></polyline>
  </svg>
  <script>
    // svg有默认的宽和高,是300*150
  </script>
</body>
</html>